<template>
	<view>
		<u-navbar :is-back="false" title="下单成功" title-color="#ffffff" :background="background"></u-navbar>
		<view class="content">
			<view class="title"><u-icon name="checkmark-circle-fill" color="#18b566" size="210"></u-icon></view>
			<view class="title-tap">
				<view>下单成功</view>
			</view>
			<view class="button"><u-button type="success" plain @click="goHome()">返回首页</u-button></view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			background: {
				backgroundImage: 'linear-gradient(90deg, rgb(0,164,133), rgb(51,241,205))'
			},
		};
	},
	onLoad(option) {
		try {
			const token = uni.getStorageSync('token');
			if (token) {
				console.log(option)
				this.userInfo = uni.getStorageSync('userInfo');
				if(!this.userInfo){
					//#ifdef APP-PLUS
					uni.reLaunch({
						url: '/pages/login/index'
					});
					//#endif
					//#ifdef MP-WEIXIN
					uni.reLaunch({
						url: '/pages/login/xcxLogin'
					});
					//#endif
				}
			} else {
				//#ifdef APP-PLUS
				uni.reLaunch({
					url: '/pages/login/index'
				});
				//#endif
				//#ifdef MP-WEIXIN
				uni.reLaunch({
					url: '/pages/login/xcxLogin'
				});
				//#endif
			}
		} catch (e) {
			// error
		}
	},
	onShow() {},
	methods: {
		goHome() {
			this.$u.route({
				type: 'tab',
				//params: {orderSn:res.data,orderSn:res.data.payPrice},
				url: '/pages/index/index',
			});
		}
	}
};
</script>

<style lang="scss">
.content {
	padding: 0 30rpx;
	.title {
		padding-top: 50rpx;
		text-align: center;
		font-size: 64rpx;
		font-weight: bold;
		color: $u-type-warning;
	}
	.title-tap {
		text-align: center;
		font-size: 36rpx;
	}
	.tips{
		text-align: center;
		margin-top: 30rpx;
	}
	.button {
		margin-top: 80rpx;
	}
}
</style>
